package com.example.firstproject.util;
import java.util.Random;

public class PhoneCodeUtil {
    public static String getCode(int length){
        Random random = new Random();
        StringBuffer code = new StringBuffer();
        for (int i = 0; i< length; i++){
            code.append(random.nextInt(10));
        }
        return code.toString();
    }

    public static void main(String[] args) {
        System.out.println(PhoneCodeUtil.getCode(6));
    }
}



